from django.db import models


class Activity(models.Model):
    bg_image = models.CharField(max_length=128, verbose_name="背景图片")
    title = models.CharField(max_length=64, verbose_name="标题")
    start = models.DateTimeField(verbose_name="开始时间")
    end = models.DateTimeField(verbose_name="结束时间")
    deadline = models.DateTimeField(verbose_name="报名截止时间")
    city = models.CharField(max_length=64, verbose_name="城市")
    status = models.SmallIntegerField(verbose_name="状态")  # choices=((1,"报名中"),(2,"活动结束"))
    address = models.CharField(max_length=128, verbose_name="举办地点")
    sponsor = models.CharField(max_length=64, verbose_name="主板方")
    link = models.CharField(max_length=128, verbose_name="链接")
    intro = models.TextField(verbose_name="简介")
    detail = models.TextField(verbose_name="详情")
    reads = models.IntegerField(verbose_name="阅读量", default=0)
    applys = models.IntegerField(verbose_name="报名数", default=0)

    def __str__(self):
        return self.title

    class Meta:
        db_table = "tb_activity"
        verbose_name = "活动"
        verbose_name_plural = verbose_name


        #
        # 主键	id	varchar
        # 背景图片	bg_image	varchar
        # 标题	title	varchar
        # 开始时间	start	datetime
        # 结束时间	end	datetime
        # 城市	city	varchar
        # 状态	status	smallinteger
        # 举办地点	address	varchar
        # 主板方	sponsor	varchar
        # 报名截止时间	deadline	datetime
        # 链接	link	varchar
        # 简介	intro	text
        # 详情	detail	text
        # 阅读量	reads	integer
        # 报名数	applys	integer
